# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.OSLogin.V1alpha.Model.LoginProfile do
  @moduledoc """
  The user profile information used for logging in to a virtual machine on Google Compute Engine.

  ## Attributes

  *   `name` (*type:* `String.t`, *default:* `nil`) - Required. A unique user ID.
  *   `posixAccounts` (*type:* `list(GoogleApi.OSLogin.V1alpha.Model.PosixAccount.t)`, *default:* `nil`) - The list of POSIX accounts associated with the user.
  *   `securityKeys` (*type:* `list(GoogleApi.OSLogin.V1alpha.Model.SecurityKey.t)`, *default:* `nil`) - The registered security key credentials for a user.
  *   `sshPublicKeys` (*type:* `%{optional(String.t) => GoogleApi.OSLogin.V1alpha.Model.SshPublicKey.t}`, *default:* `nil`) - A map from SSH public key fingerprint to the associated key object.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :name => String.t() | nil,
          :posixAccounts => list(GoogleApi.OSLogin.V1alpha.Model.PosixAccount.t()) | nil,
          :securityKeys => list(GoogleApi.OSLogin.V1alpha.Model.SecurityKey.t()) | nil,
          :sshPublicKeys =>
            %{optional(String.t()) => GoogleApi.OSLogin.V1alpha.Model.SshPublicKey.t()} | nil
        }

  field(:name)
  field(:posixAccounts, as: GoogleApi.OSLogin.V1alpha.Model.PosixAccount, type: :list)
  field(:securityKeys, as: GoogleApi.OSLogin.V1alpha.Model.SecurityKey, type: :list)
  field(:sshPublicKeys, as: GoogleApi.OSLogin.V1alpha.Model.SshPublicKey, type: :map)
end

defimpl Poison.Decoder, for: GoogleApi.OSLogin.V1alpha.Model.LoginProfile do
  def decode(value, options) do
    GoogleApi.OSLogin.V1alpha.Model.LoginProfile.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.OSLogin.V1alpha.Model.LoginProfile do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
